<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/22/022
 * Time: 13:50
 */

namespace app\Lib\Model\Tag\HouseTypeTag;


use app\Lib\Model\Img\Img;

class GetInfo
{
    private $styleTag;
    public function __construct(HouseTypeTag $styleTag)
    {
        $this->styleTag = $styleTag;
    }

    public function run(){
        $model = $this->styleTag;
        $imgClass = $model->getImgClass();
        $img = [];
        if($imgClass instanceof  Img){
           $img = [
               'imgId'=>$model->getImgClass()->getImgId(),
               'imgUrl'=>$model->getImgClass()->getFilePath(),
               'imgName'=>$model->getImgClass()->getFilename(),
           ];

        }

        $data = [
            'id'=>$model->getTagId(),
            'tagName'=>$model->getTagName(),
        ];

        return array_merge($data,$img);
    }
}